﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevComponents.DotNetBar;
using DiBang.Common;

namespace ChangWuDiBang
{
    public partial class FrmBase64Encoding : Office2007Form
    {
        public FrmBase64Encoding()
        {
            this.EnableGlass = false;
            InitializeComponent();
        }

        private void btnBase_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtNormal.Text.Trim()))
            {
                MessageBox.Show("请输入需要编码的字符串!");
                return;
            }

            string baseString = Base64Encoding.BaseEncoding(txtNormal.Text.Trim());
            txtBase.Text = baseString;
        }

        private void btnUnBase_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtBase.Text.Trim()))
            {
                MessageBoxEx.Show("请输入解码的字符串!");
                return;
            }

            string unBaseString = Base64Encoding.UnBaseEnconding(txtBase.Text.Trim());
            txtNormal.Text = unBaseString;
        }


    }
}
